﻿// 红黑树.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <iostream>
#include <vector>
#include"RBTree.h"
int main()
{
	/*RBTree<int, int> t;
	int i = 1000000;
	srand(time(0));
	while (i)
	{
		int a = rand();
		t.Insert(make_pair(a, a));
		i--;
	}*/
	const int N = 1000000;
	vector<int> v;
	v.reserve(N);
	srand(5);

	for (size_t i = 0; i < N; i++)
	{
		int a = rand();
		v.push_back(a);
	}

	RBTree<int, int> rbt;
	for (auto e : v)
	{
		rbt.Insert(make_pair(e, e));
		//cout << "Insert:" << e << "->" << t.IsBalance() << endl;
	}
	cout << rbt.IsBalance() << endl;
	cout << rbt.Height() << endl;
	return 0;
}